var app = getApp();
Page({
    data:{
        showall : false,
        sharedata : {},
		siteroot : app.siteInfo.siteroot.replace('app/index.php', ''),uniacid: app.siteInfo.uniacid,
    },
    onLoad:function(options){
        var self = this;
        var id = options.id ? options.id : '';
        id = options.scene ? options.scene : id;

        app.com.http('wxlive','POST',{op:'bakcv',id:id},0,false,'','',function(res){
            if (!res.data.errno && res.data) {
                self.setData({
                    info : res.data.data.info,
                    goods : res.data.data.goods,
                    sharedata : res.data.data.sharedata,
                    inited : true,
                });
                wx.setNavigationBarTitle({
                    title: res.data.data.info.name
                });

            }else{
                app.com.alert(res.data.message,function(){
                    app.com.backPage(0);
                });
            }
        });
    },
    onShareAppMessage : function(){
        var self = this;
        return {
            title: self.data.sharedata.title,
            path: self.data.sharedata.path,
            imageUrl : self.data.sharedata.img,
        }
    },
    back(e){
        app.com.backPage(0);
    },
    showallfn(){
        this.setData({
            showall : !this.data.showall,
        })
    },
    location : function( e ){
        app.com.location( e );
    },
    otherapp : function( e ){
        app.com.otherapp( e );
    },
    navigateto : function( e ){
        app.com.navigateto( e);
    },
    redirectto : function( e ){
        app.com.redirectto( e );
    },    
    callphone : function(e){
        app.com.callphone( e );
    },
    showimages : function( e ){
        app.com.showimages( e );
    },
    footNavigate(e){
        var url = e.currentTarget.dataset.url;
        wx.switchTab({
          url: url
        })
    },
    
})